-- stack: in -- format: 8 (HyperCard 1) -- flags: 0x0 (none) -- protect password hash: 0 -- maximum user level: 5 (scripting) -- window: Rect(x1=0, y1=0, x2=0, y2=0) -- screen: Rect(x1=0, y1=0, x2=0, y2=0) -- card dimensions: w=0 h=0 -- scroll: x=0 y=0 -- background count: 1 -- first background id: 2583 -- card count: 13 -- first card id: 4144 -- list block id: 3862 -- print block id: 3442 -- font table block id: 0 -- style table block id: 0 -- free block count: 0 -- free size: 0 bytes -- total size: 41120 bytes -- stack block size: 8704 bytes -- created by hypercard version: 0x00000000 -- compacted by hypercard version: 0x00000000 -- modified by hypercard version: 0x00000000 -- opened by hypercard version: 0x00000000 -- patterns[0]: 0x0000000000000000 -- patterns[1]: 0x8000000008000000 -- patterns[2]: 0x8800220088002200 -- patterns[3]: 0x8888222288882222 -- patterns[4]: 0x88AA22AA88AA22AA -- patterns[5]: 0xCCAA33AACCAA33AA -- patterns[6]: 0xEEAABBAAEEAABBAA -- patterns[7]: 0xEEBBBBEEEEBBBBEE -- patterns[8]: 0xFFBBFFEEFFBBFFEE -- patterns[9]: 0xFFBBFFFFFFBBFFFF -- patterns[10]: 0x8010022001084004 -- patterns[11]: 0xFFFFFFFFFFFFFFFF -- patterns[12]: 0x8822882288228822 -- patterns[13]: 0x1122448811224488 -- patterns[14]: 0xC4800C6843023026 -- patterns[15]: 0xB130031BD8C00C8D -- patterns[16]: 0xAA00AA00AA00AA00 -- patterns[17]: 0x8822552288225522 -- patterns[18]: 0x8855225588552255 -- patterns[19]: 0x77DD77DD77DD77DD -- patterns[20]: 0x8000000000000000 -- patterns[21]: 0xAA55AA55AA55AA55 -- patterns[22]: 0x038448300C020101 -- patterns[23]: 0x8244394482010101 -- patterns[24]: 0x8814224188412214 -- patterns[25]: 0x8080413E080814E3 -- patterns[26]: 0x22048C7422179810 -- patterns[27]: 0xBE808808EB088880 -- patterns[28]: 0x25C8328964244C92 -- patterns[29]: 0xA29C41BE2AC914EB -- patterns[30]: 0x40A00000040A0000 -- patterns[31]: 0x8040200002040800 -- patterns[32]: 0xAA00800088008000 -- patterns[33]: 0xFF80808080808080 -- patterns[34]: 0x081C22C180010204 -- patterns[35]: 0xFF808080FF080808 -- patterns[36]: 0xF87422478F172271 -- patterns[37]: 0xBF00BFBFB0B0B0B0 -- patterns[38]: 0xFF7FBE5DA2418000 -- patterns[39]: 0xFAF5FAF5A050A050 -- checksum: 0x0 ----- HyperTalk script ----- on openstack go to card Index global prioruserlevel get the userLevel put it into prioruserlevel set the userLevel to 5 -- create the menus -- keep the "handles" to the menus in these globals global menu1 put NewMenu("XrefText/M","Go To Reference","Create Reference", "(-","Back Up","Back To Index","(-","New XrefText Stack", "Toggle Picture","Import Text","Output","(-","XrefText-M Help")into menu1 if menu1 is 0 then answer("Unable to make menu 'BEEP'") with "Drat" end openstack on closestack global prioruserlevel set the userLevel to prioruserlevel set the loc of msg to 22,300 -- delete the menus we've created using --the globals saved in openStack global menu1 put DeleteMenu(menu1) into menu1 -- clearing global for safety end closestack on doMenu which -- get our menu items from doMenu before HyperCard does... global menu1, menu2 -- for CheckMenu and EnableMenu below if which is "Go To Reference" then put the selection into holder push card visual effect wipe right to black visual effect wipe left find holder in field keywords if the result is not empty then answer "No match for keyword " "e& holder"e pop card end if else if which is "Create Reference" then put the selection into holder type ">" & holder & "<" push card find holder in field keywords if the result is not empty then doMenu New Card put holder into field keywords set the name of this card to holder get the number of lines in card field finder of card theIndex put holder into line it+1 of card field finder of card theIndex else put the length of holder into hl put the length of word 1 of field keywords into kl if hl<>kl then answer "Close match but not exact!" with "Good Enough" or "New Card" if it contains "New" then set lockscreen to true go prev doMenu New Card put holder into field keywords set the name of this card to holder get the number of lines in card field finder of card theIndex put holder into line it+1 of card field finder of card theIndex set lockscreen to false end if end if end if else if which is "Back Up" then if the number of this card = 1 then answer "Careful. You might leave this stack." with Cancel or OK if it = "OK" then visual effect wipe left to black visual effect wipe right go back else exit doMenu end if else visual effect wipe left to black visual effect wipe right pop card end if else if which is "Back To Index" then if the number of this card > 1 then -- visual effect wipe down to black visual effect iris close to white visual effect dissolve go to first card else play boing answer "You're already at the first card!" end if else if which is "XrefText-M Help" then visual effect dissolve go card ayuda else if which is "Toggle Picture" then if the number of this card > 2 then answer "Change to Picture or Text?" with Text or Picture if it contains "Text" then show tool window choose select tool doMenu Select All doMenu Clear Picture choose browse tool hide tool window hide pattern window else show pattern window show tool window choose rectangle tool set filled to false drag from (item 1 of the rect of field keywords), (item 2 of the rect of field keywords) to (item 3 of the rect of field keywords), (item 4 of the rect of field keywords) drag from 0,28 to 512,342 choose bucket tool set pattern to 1 click at 250,250 choose text tool set the textfont to Geneva set the textsize to 9 click at 10,320 type "Don't use eraser. Use white brush instead." click at 10,330 type "Choosing Browse Tool will show XrefText/M menu." choose brush tool end if else play boing answer "Uh-uh. You don't want to change this card." end if else if which is "Import Text" then if the number of this card > 2 then if field body is empty then put FileName("TEXT") into theFile if theFile is not empty then open file theFile read from file theFile for 16000 put it into bkgnd field body close file theFile end if else answer "Import Text: Replace or Add to field contents?" with "Replace" or "Add" or "Cancel" if it = "Cancel" then exit mouseup if it = "Replace" then put FileName("TEXT") into theFile if theFile is not empty then open file theFile read from file theFile for 16000 put it into bkgnd field body close file theFile end if else put return after last line of bkgnd field body put FileName("TEXT") into theFile if theFile is not empty then open file theFile read from file theFile for 16000 put the number of lines in field body into liner put it after line liner of bkgnd field body close file theFile end if end if end if else play boing Answer "Don't import to Index or Help Card!" end if else if which is "Output" then answer "Output to printer or to text file?" with "Printer" or "File" or "Cancel" if it = "Cancel" then exit doMenu else if it = "Printer" then answer "Print the stack or a report of its text" with "Stack" or "Report" or "Cancel" if it = "Cancel" then exit doMenu else if it = "Stack" then doMenu Print Stack... else if it = "Report" then doMenu Print Report... end if else if it = "File" then answer "Save a file of the Stack or of this Card?" with "Stack" or "Card" or "Cancel" if it = "Cancel" then exit mouseup else if it = "Stack" then put the number of cards into counter go to first card put the short name of this stack & ".text" into tfilename Get PutFile("Save text as:",tfilename) if it is empty then exit doMenu put it into textfile set cursor to 4 set the loc of message to 10,120 put "Writing to file " & textfile & ". Please wait..."into message open file textfile repeat (counter - 1) go next card write field keywords to file textfile write return to file textfile write field body to file textfile write return to file textfile write return to file textfile end repeat close file textfile go first card play harpsichord c e g bb flash 1 put "Done." into message wait 2 seconds hide message else if it = "Card" then put the short name of this card & ".text" into tfilename Get PutFile("Save text as:",tfilename) if it is empty then exit doMenu put it into textfile open file textfile write field keywords to file textfile write return to file textfile write field body to file textfile close file textfile end if end if else if which is "New XrefText Stack" then put the short name of this stack into checker doMenu New Stack... get the short name of this stack if it = checker then exit doMenu put it into field "keywords" push card go back --- go to second card doMenu "Copy Card" pop card doMenu "Paste Card" push card --- go to first card of stack checker doMenu "Copy Card" pop card go prev doMenu "Paste Card" click at the loc of button "Re-Index" else pass doMenu -- Remember to pass on menu commands you don't trap! end doMenu on idle -- call ShowMenu every so often just in case our menus vanished global menu1, lastTick if (the ticks-lastTick)>120 then -- gives better performance than on every iteration put the ticks into lastTick ShowMenu(menu1) end if pass idle end idle